package com.ricchieri.dao;

import java.util.List;

import org.hibernate.Criteria;

import com.ricchieri.dao.interf.ITravelDao;
import com.ricchieri.filter.BasicFilter;
import com.ricchieri.model.Travel;

public class TravelDao extends GenericDao implements ITravelDao {
	private static final long serialVersionUID = 5995324838201269601L;

	@Override
	@SuppressWarnings("unchecked")
	public List<Travel> getAllTravel(BasicFilter filter) {
		Criteria criteria = criteriaAllTravel(filter);
		
		return criteria.list();
	}
	
	private Criteria criteriaAllTravel(BasicFilter filter) {
		return super.criteriaAllBasic(filter, Travel.class);
	}	
	
	@Override
	protected String getTableName() {
		return "travel";
	}
}
